package com.example.zhangyu.myapplication;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {


    private int screenWidth;
    private int screenHeight;
    private TextView moveIv;
    private TextView move_iv2;
    private TextView move_iv3;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        DisplayMetrics dm = getResources().getDisplayMetrics();
        screenWidth = dm.widthPixels;
        screenHeight = dm.heightPixels - 50;

        moveIv = (TextView) findViewById(R.id.move_iv1);
        moveIv.setOnClickListener(this);

        move_iv2 = (TextView) findViewById(R.id.move_iv2);
        move_iv2.setOnClickListener(this);
        move_iv3= (TextView) findViewById(R.id.move_iv3);
        move_iv3.setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.move_iv1:
                startActivity(new Intent(MainActivity.this, MoveActivity1.class));
                break;
            case R.id.move_iv2:
                startActivity(new Intent(MainActivity.this, MoveActivity2.class));
                break;
            case R.id.move_iv3:
                startActivity(new Intent(MainActivity.this, MoveActivity3.class));
                break;
        }
    }
}
